home *** CD-ROM | disk | FTP | other *** search
/ Java for 3D & VRML Worlds / Java for 3d and VRML Worlds.iso / examples / chap06 / TV.wrl < prev    next >
Text File  |  1996-10-14  |  2KB  |  77 lines

  1. #VRML V2.0 utf8
  2.  
  3. #
  4. # TV
  5. #
  6.  
  7. # TV body
  8. Transform{
  9.         children[
  10.         Shape{
  11.                 geometry IndexedFaceSet{
  12.                         coord DEF COORD Coordinate{
  13.                                 point[  
  14.                                         0 0 0,          #0
  15.                                         15 0 0,         #1
  16.                                         15 10 0,        #2
  17.                                         0 10 0,         #3
  18.                                 ]
  19.                         }
  20.                         coordIndex [0, 1, 2, 3, -1]
  21.                         solid FALSE
  22.                 }
  23.                 appearance Appearance{
  24.                         texture DEF TV MovieTexture{
  25.                                 url "tv.jpg"
  26.                                 loop TRUE
  27.                                 startTime 0     # initially not playing
  28.                                 stopTime 1
  29.                         }
  30.                 }
  31.         }
  32.         ]
  33. }
  34.  
  35. # play button
  36. Transform{
  37.         translation 2 -1 0
  38.         children[
  39.         Shape{geometry Box{size 4 1 0.1}},
  40.         DEF PLAY_BUTTON TouchSensor{}
  41.         ]
  42. }
  43. Transform{
  44.         translation 1 -3 0
  45.         children[
  46.         Shape{
  47.                 geometry Text{
  48.                         string "Play"
  49.                         fontStyle FontStyle{}
  50.                 }
  51.         }
  52.         ]
  53. }
  54.  
  55. # stop button
  56. Transform{
  57.         translation 13 -1 0
  58.         children[
  59.         Shape{geometry Box{size 4 1 0.1}},
  60.         DEF STOP_BUTTON TouchSensor{}
  61.         ]
  62. }
  63. Transform{
  64.         translation 12 -3 0
  65.         children[
  66.         Shape{
  67.                 geometry Text{
  68.                         string "Stop"
  69.                         fontStyle FontStyle{}
  70.                 }
  71.         }
  72.         ]
  73. }
  74.  
  75. ROUTE PLAY_BUTTON.touchTime TO TV.set_startTime
  76. ROUTE STOP_BUTTON.touchTime TO TV.set_stopTime
  77.